<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 客户验证器
 */
class Customers extends AdminBase
{
    
    // 验证规则
    protected $rule =   [
        
    
        'name'              => 'require|unique:blogroll',
        'sex'              => 'require',
        'address'           => 'require',
        'phone'            => 'require|number',
        'career'           => 'require',
        

    ];   

    // 验证提示
    protected $message  =   [
        
    
        'name.require'            => '客户名称不能为空',
        'sex.number'              => '客户性别',
        'address.require'          => '客户地址不能为空',
        'phone.number'            => '客户电话必须为数字',
        'career.require'          => '客户职业不能为空'
        
    ];

    // 应用场景
    protected $scene = [
        
        'edit' =>  ['name','sex','address','phone','career'],
    ];
    
}

